In a communications system, channel coding is usually used to improve reliability of data transmission and ensure communication quality. Polar (Polar) code is an encoding manner that can achieve a Shannon capacity and has low encoding/decoding complexity. A polar code is a linear block code. For the polar code, a generator matrix is GN, and an encoding process is x1N=u1NGN., where u1N=(u1,u2,K,uN) is a binary row vector, GN=BNF2⊗(log2(N)), a code length is N=2n, and n≥0.
      F    2    =            [                                    1                                0                                                1                                1                              ]        .  
BN is an N×N transposed matrix, for example, a bit reversal matrix. F2⊗(log2(N)) is a Kronecker power (Kronecker power) of F2 and is defined as F⊗(log2(N))=F⊗F⊗((log2(N))−1).
In the encoding process of the polar code, some bits in u1N are used to carry information, and are referred to as information bits. A sequence number set of these information bits is denoted by A. The rest of the bits are set to fixed values pre-agreed on by a transmitter side and a receiver side, and are referred to as frozen bits. A sequence number set of the frozen bits is denoted by Ac, a complementary set of A. Generally, these frozen bits are set to 0. In practical, the frozen bits may be set randomly, as long as a pre-agreement is made between the transmitter side and the receiver side. Therefore, a coded bit sequence of the polar code may be obtained by using the following method: x1N=uAGN (A). Herein, uA is an information bit set in u1N, and uA is a row vector with a length K, that is, |A|=K, where |⋅| represents a quantity of elements in a set. In other words, K represents not only a quantity of elements in the set A, but also a quantity of to-be-encoded information bits. GN (A) is a sub-matrix consisting of rows in the matrix GN that are corresponding to indexes in the set A, and GN (A) is a K×N matrix. How the set A is selected determines performance of the polar code.
In an existing communications system, a transmitter side determines a code length and a code rate for channel coding, based on channel state information fed back by a receiver side in combination with a length of a to-be-sent message sequence, an available physical channel resource, and other information. An encoder at the transmitter side encodes a to-be-transmitted message sequence based on the code length and the code rate. Because different code lengths and code rates are corresponding to different codebooks, the encoder needs to store information about all codebooks. Likewise, to decode a received channel, a decoder also needs to store all the codebooks.
A codebook for a polar code depends on a code length M of a mother code and an information bit sequence number set A. In an existing polar code solution, neither an information bit sequence number set nor a bit selection order that is used for rate adaptation can be obtained through calculation by using a simple method. Therefore, for every possible code length and code rate, a polar code encoder and a polar code decoder need to store a corresponding information bit sequence number set and a rate adaptation table. These information bit sequence number sets and rate adaptation tables mean that a polar code is pre-constructed through density approximation in an offline manner by selecting a set of parameters according to a specific rule, depending on an actual system requirement and a working signal-to-noise ratio interval.
To support all code length and code rate combinations required by a system, a huge quantity of lookup tables need to be stored for encoding/decoding and rate adaptation of polar codes. Such storage overheads are intolerable for hardware system implementation.
Therefore, how to effectively encode/decode a polar code needs to be resolved urgently.